package com.portal.service.impl;

import org.apache.ibatis.session.RowBounds;

import com.portal.dao.system.FunInfoDao;
import com.portal.dao.system.RoleDao;
import com.portal.dao.system.RolePowerDao;
import com.portal.dao.system.SysMenuDao;
import com.portal.dao.system.UserDao;
import com.util.portal.PageConfig;

/**
 * Service实现类基类
 * 
 * @author liu.qiao
 *
 * @param <T>
 * @param <PK>
 */
public class BaseService {
	/**
	 * 分页查询范围
	 */	
	public RowBounds getRowBounds(PageConfig pageConfig) {
		if(pageConfig==null){
			pageConfig = new PageConfig();
		}
		int pageIndex = pageConfig.getPageIndex();
		int startRow =1;
		if (pageIndex<=1){
			startRow =1;
		}else{
			 startRow = (pageConfig.getPageIndex()-1)*pageConfig.getPageSize()+1;
		}
		
		RowBounds rowBounds = new RowBounds(startRow,pageConfig.getPageSize());
		return rowBounds;
	}
	
	/**
	 * 系统用户
	 */
	private UserDao UserDao = null;
	/**
	 * 系统菜单
	 */
	private SysMenuDao SysMenuDao = null;
	/**
	 * 系统功能点
	 */
	private FunInfoDao funInfoDao = null;
	/**
	 * 系统角色
	 */
	private RoleDao RoleDao = null;
	/**
	 * 系统角色权限
	 */
	private RolePowerDao rolePowerDao = null;

	public UserDao getUserDao() {
		return UserDao;
	}

	public void setUserDao(UserDao UserDao) {
		this.UserDao = UserDao;
	}

	public SysMenuDao getSysMenuDao() {
		return SysMenuDao;
	}

	public void setSysMenuDao(SysMenuDao sysMenuDao) {
		SysMenuDao = sysMenuDao;
	}

	public RoleDao getRoleDao() {
		return RoleDao;
	}

	public void setRoleDao(RoleDao roleDao) {
		RoleDao = roleDao;
	}

	public RolePowerDao getRolePowerDao() {
		return rolePowerDao;
	}

	public void setRolePowerDao(RolePowerDao rolePowerDao) {
		this.rolePowerDao = rolePowerDao;
	}

	public FunInfoDao getFunInfoDao() {
		return funInfoDao;
	}

	public void setFunInfoDao(FunInfoDao funInfoDao) {
		this.funInfoDao = funInfoDao;
	}

	
}
